﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace QueueSimulator
{
    public class Queue
    {
        public double ArrivalPercentage { get; set; }

        public int ArrivalTimeMin { get; set; }
        public int ArrivalTimeMax { get; set; }

        public int ServiceTimeMin { get; set; }
        public int ServiceTimeMax { get; set; }

        public int Servers { get; set; }
        public int Capacity { get; set; }

        public int Size { get; set; }

        public List<QueueStatistic> Statistics { get; private set; }

        public Queue(double arrivalPercentage, int serviceMin, int serviceMax, int servers, int capacity)
            : this(serviceMin, serviceMax, servers, capacity)
        {
            ArrivalPercentage = arrivalPercentage;
        }

        public Queue(int arrivalMin, int arrivalMax, int serviceMin, int serviceMax, int servers, int capacity)
            : this(serviceMin, serviceMax, servers, capacity)
        {
            ArrivalTimeMin = arrivalMin;
            ArrivalTimeMax = arrivalMax;
        }

        private Queue(int serviceMin, int serviceMax, int servers, int capacity)
        {
            ServiceTimeMin = serviceMin;
            ServiceTimeMax = serviceMax;
            Servers = servers;
            Capacity = capacity;

            Size = 0;

            Statistics = new List<QueueStatistic>();

            for (int x = 0; x <= Capacity; x++)
            {
                Statistics.Add(new QueueStatistic() { State = x, Time = 0.0 });
            }
        }
    }
}
